<?php
namespace app\common\traits;

use app\admin\logic\Depar;
use app\admin\model\Sites;
use app\admin\model\WeixinAccount;

trait Text{

    /**信息启用状态
     * @param $value
     * @param $data
     * @return mixed
     */
    public function getStatusTextAttr($value, $data){
        $status = [
            0=> "<span class=\"label label-danger\">禁用</span> - <a class=\"setStatus_btn\" data-id=".$data['id']." style=\"color: blue\">启用</a>",

            1=>"<span class=\"label label-success\">启用</span> - <a class=\"setStatus_btn\" data-id=".$data['id']." style=\"color: red\">禁用</a>"
        ];
        return $status[$data['status']];
    }

    /**
     * 微信绑定状态
     * @param $value
     * @param $data
     * @return mixed
     */
    public function getWeixinstatusTextAttr($value, $data)
    {
        $status = [
            1 => "<span class=\"label label-success\">已绑定</span>",
            2 => "<span  class=\"label label-danger\">未绑定</span>",
        ];
        return $status[$data['weixinstatus']];
    }


    /**
     * 所有部门
     * @param $value
     * @param $data
     * @return mixed
     */
    public function getDeparTextAttr($value, $data)
    {
        $status = Depar::deparsToText();
        return $status[$data['depar_id']];
    }


    /**操作端类型
     * @param $value
     * @param $data
     * @return mixed
     */
    public function getKhdTextAttr($value, $data){
        $status = [1=>'PC端',2=>'手机端',3=>'系统处理'];
        return $status[$data['khd']];
    }

    /**日志操作类型
     * @param $value
     * @param $data
     * @return mixed
     */
    public function getOperationTextAttr($value, $data)
    {
        $status = [
            1=>"新增订单",
            2=>"修改订单",
            3=>"删除订单",
            4=>"分配专员",
            5=>"分配会所",
            6=>"意向反馈",
            7=>"短信发送",
            9=>"金牌匹配",
            8=>"邀约拍摄",
        ];
        return $status[$data['operation']];
    }




}